﻿
Imports elpmis
Imports webctrl

Namespace httpFunctions
    Public Class _jsrnd
        Inherits internalFunction

        Public Class parameters
            Public Const page As String = "page"
            Public Const inlineScript As String = "inlineScript"
        End Class

        Private Shared m As iParametersMapping = Nothing

        Shared Sub New()
            initialMapping(m, parameters.page)
        End Sub

        Public Sub New()
            MyBase.New("js.rnd", m)
        End Sub

        Protected Overrides Function invoke(ByVal ctx As context, ByRef output As bare_variable) As Boolean
            Dim inlineScript As inlineScript = Nothing
            getinlinescript(ctx, inlineScript, parameters.page, parameters.inlineScript)
            output = New bare_variable(typeDefination.string, _
                                       jsrnd.invoke(inlineScript))
            Return True
        End Function
    End Class
End Namespace
